#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	freopen("sort.in","r",stdin);
	freopen("sort.out","w",stdout);
	int t,n,q,a[8002]={0},b[8002]={0},c[8002]={0},d[8002]={0},x,v;
	cin>>n>>q;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		c[i]=i;
	}
	for(int i=1;i<=n;i++){
		d[i]=a[i];
	}
	for(int i=1;i<=q;i++){
		int k=0,t=0;
		cin>>k;
		if(k==1){
			cin>>x>>v;
			a[x]=v;
		}
		if(k==2)
			cin>>t;
			for(int j=1;j<=n;j++){
				d[j]=a[j];
			}
			sort(d+1,d+n+1);
			int flag=0;
			for(int j=n;j>=1;j--){
				if(a[t]==d[j]&&flag==0){
					cout<<j<<endl;
					flag=1;
				}
			}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
 } 
